#ifndef VIEWPOINT_HPP
#define VIEWPOINT_HPP
#include "Mat4.hpp"
// Creates the view matrix based on a position and point vector
class ViewPoint
{
   public:

      ViewPoint();
      Vec3 Up() const { return mUp; }
      Vec3 Right() const { return mRight; }
      Vec3 Forward() const { return mForward; }

      void PointAt(Vec3 aTarget, Vec3 aRight, Vec3 aUp);
      void RotateAround(float aPivotDistance,
                        float aUpRotationAngle,
                        float aRightRotationAngle);
      void SetUp(Vec3 aUp);

      Vec3 Origin() const { return mOrigin; }

      void Move(Vec3 aDelta) { SetOrigin(mOrigin + aDelta); }
      void SetOrigin(Vec3 aOrigin);

      Mat4& WorldToLocal() { return mWorldToLocal; }
      Mat4& LocalToWorld() { return mLocalToWorld; }

   private:
      void UpdateMatrix();
      Mat4 mWorldToLocal;
      Mat4 mLocalToWorld;

      Vec3 mOrigin;
      Vec3 mUp;
      Vec3 mRight;
      Vec3 mForward;

};
#endif // VIEWPOINT_HPP
